﻿@{
    ViewBag.CurrentPage = WebApp.Common.PageSetting.ConfigurationPageSetting;    
}

@{ var sectionId = (Request.IsAjaxRequest() ? "Ajax" : "View") + "_CoreConfiguration_Index"; }

@section Scripts{
    <script type="text/javascript">
        require(['CoreConfiguration/Index', 'util'], function (api) {
            $(function () { api.exec('@sectionId'); });
        });
    </script>
}

<div class="container" data-bind="stopbinding: true">
    <section id="@sectionId">
        <div class="row">
            <a href="#" class="btn btn-primary" data-bind="click: downloadAttandanceReport">Download Attandence Report</a>
        </div>
        <div class="row" style="margin-left:0">
            <div class="col-md-2">                
                <div class="h3">Choose</div>
                <ul class="list-unstyled">
                    <li class="btn btn-link  configOptionLineHeight" data-bind="click: emailConfig, css: { configOptionClass: emailConfiguration() }"><span style="margin-left: 5px;">Email Configuration</span></li>
                    <li class="btn btn-link  configOptionLineHeight" data-bind="click: smsConfig, css: { configOptionClass: smsConfiguration() }"><span style="margin-left: 5px;">Sms Configuration</span></li>
                    <li class="btn btn-link  configOptionLineHeight" data-bind="click: networkConfig, css: { configOptionClass: networkConfiguration() }"><span style="margin-left: 5px;">Network Configuration</span></li>
                </ul>
            </div>
            <div class="col-md-10">
                <div class="col-md-8" data-bind="with: email, visible: emailConfiguration" style="display: none;text-align: left; margin-left: 0;">
                    <div class="pull-right">
                        <a href="#" class="btn btn-primary" data-bind="click: edit, visible: !editting()" title="Edit"><i class="icon icon-edit"></i></a>
                        <a href="#" class="btn btn-primary" data-bind="click: update, visible: editting()" title="Update"><i class="icon icon-thumbs-up"></i></a>
                        <a href="#" class="btn btn-primary" data-bind="click: cancel, visible: editting()" title="Cancel"><i class="icon icon-undo"></i></a>
                    </div>
                    <table class="table table-condensed well">
                        <thead>
                            <tr>
                                <th class="col-xs-4">Name</th>
                                <th class="col-xs-6">Value</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><span>MailHost</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: mailHost" />
                                    <span data-bind="visible: !editting(), text: mailHost"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>Port</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: port" />
                                    <span data-bind="visible: !editting(), text: port"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>User</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: user" />
                                    <span data-bind="visible: !editting(), text: user"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>Password</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: password" />
                                    <span data-bind="visible: !editting(), text: password"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>From</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: from" />
                                    <span data-bind="visible: !editting(), text: from"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>DisplayName</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: displayname" />
                                    <span data-bind="visible: !editting(), text: displayname"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>ReplyTo</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: replyTo" />
                                    <span data-bind="visible: !editting(), text: replyTo"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>IsSecureSocket</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: ssl" />
                                    <span data-bind="visible: !editting(), text: ssl"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>IsTransportLayerSecurity</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: tls" />
                                    <span data-bind="visible: !editting(), text: tls"></span>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="col-md-8 " data-bind="with: sms, visible: smsConfiguration" style="display: none;text-align: left; margin-left: 0;">
                    <div class="pull-right">
                        <a href="#" class="btn btn-primary" data-bind="click: edit, visible: !editting()" title="Edit"><i class="icon icon-edit"></i></a>
                        <a href="#" class="btn btn-primary" data-bind="click: update, visible: editting()" title="Updae"><i class="icon icon-thumbs-up"></i></a>
                        <a href="#" class="btn btn-primary" data-bind="click: cancel, visible: editting()" title="Cancl"><i class="icon icon-undo"></i></a>
                    </div>
                    <table class="table table-condensed well">
                        <thead>
                            <tr>
                                <th class="col-xs-4">Name</th>
                                <th class="col-xs-6">Value</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><span>Service Url</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: serviceUrl" />
                                    <span data-bind="visible: !editting(), text: serviceUrl"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>Sender Name</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: senderName" />
                                    <span data-bind="visible: !editting(), text: senderName"></span>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="col-md-8 " data-bind="with: network, visible: networkConfiguration" style="display: none;text-align: left; margin-left: 0">
                    <div class="pull-right">
                        <a href="#" class="btn btn-primary" data-bind="click: edit, visible: !editting()" title="Edit"><i class="icon icon-edit"></i></a>
                        <a href="#" class="btn btn-primary" data-bind="click: update, visible: editting()" title="Update"><i class="icon icon-thumbs-up"></i></a>
                        <a href="#" class="btn btn-primary" data-bind="click: cancel, visible: editting()" title="Cancel"><i class="icon icon-undo"></i></a>
                    </div>
                    <table class="table table-condensed well">
                        <thead>
                            <tr>
                                <th class="col-xs-4">Name</th>
                                <th class="col-xs-6">Value</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><span>Proxy Address</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: proxyHost" />
                                    <span data-bind="visible: !editting(), text: proxyHost"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>Port</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: proxyPort" />
                                    <span data-bind="visible: !editting(), text: proxyPort"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>User Name</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: userName" />
                                    <span data-bind="visible: !editting(), text: userName"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>Password</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: password" />
                                    <span data-bind="visible: !editting(), text: password"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>Use Proxy</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: useProxy" />
                                    <span data-bind="visible: !editting(), text: useProxy"></span>
                                </td>
                            </tr>
                            <tr>
                                <td><span>Use Credential</span></td>
                                <td>
                                    <input type="text" class="form-control" data-bind="visible: editting(), value: useCredential" />
                                    <span data-bind="visible: !editting(), text: useCredential"></span>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </section>
</div>

